import { ElMessage } from "element-plus";






const alert=(data)=>{
    if(data.code==0){
        ElMessage({
         message: data.message,
         type: "success"
       });
     }else if(data.code==1){
        ElMessage({
         message: data.message,
         type: "error"
       });
     }
}



const networkRequired=(data)=>{
  let f=false;
  data.ip.forEach((item) => {
    if (item) {
      f=true;
    }
  });
  
  let f1=false;
  data.gateway.forEach((item) => {
    if (item) {
      f1=true;
    }
  });
  
  let f2=false;
  data.mac.forEach((item) => {
    if (item) {
      f2=true;
    }
  });
   if(f||f1||f2){
    return true;
   }
   return false;
}







export {
  alert,
  networkRequired
}